Differential phase contrast imaging (DPCI) is an emerging technology that has a potential to improve the diagnostic value of X-ray imaging. For example, one application of this technology is mammography. In a DPCI system, a setup is used with three gratings between the X-ray source and the detector. For image acquisition, several X-ray images at different relative positions of two of the gratings are provided. Since the gratings have pitches in the order of a few micrometers only, there are rather tight requirements on the accuracy of the stepping device that performs the relative movement of the gratings, and also for alignment of the system. For larger objects, for example when investigating a breast, the virtual phase stepping is provided by using a scan of the object relative to the imaging system, including a virtual phase stepping parallel to this scan direction. For example, either the imaging system is moved relative to the sample/object, for example as application in mammography known from the Philips-owned company Sectra, Sweden, or the object/sample is moved with respect to a fixed imaging system, for example for security screening or baggage inspection. However, a requirement for all these setups is that across all detector lines, over the width D, i.e. parallel to the scan direction X, a phase shift of at least one interference fringe period of the interferometer, i.e. the analyser grating G2 and the phase grating G1, shows up. During the scan, each individual part of the object/sample successively passes the different detector lines, thus experiencing different phase states of the interferometer. The phase retrieval is then done by an evaluation of the detector line signal taken during the scan. As a requirement, the distance between the two gratings G1 and G2, i.e. the phase grating and the analyser grating, has to be adjusted precisely. Further, also the distance between the source grating GO and the phase grating G1 has to be aligned precisely in all cases. However, it has been shown that tuning and stabilizing such an interferometer in hospital environments, for example, may consume unnecessary time and be cost-intensive.